//
//  JOAccount.m
//  新浪微博模拟
//
//  Created by song on 15/9/14.
//  Copyright (c) 2015年 song. All rights reserved.
//

#import "JOAccount.h"

@implementation JOAccount


+(id)accountWithDic:(NSDictionary *)dic
{
    return [[self alloc] initWithDic:dic];
}

-(instancetype)initWithDic:(NSDictionary *)dic
{
    if(self = [super init])
    {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

-(void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:_access_token forKey:@"access_token"];
    [aCoder encodeInt64:_expires_in forKey:@"expires_in"];
    [aCoder encodeInt64:_remind_in forKey:@"remind_in"];
    [aCoder encodeInt64:_uid forKey:@"uid"];
}

-(id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if(self)
    {
        self.access_token =[aDecoder decodeObjectForKey:@"access_token"];
        self.expires_in =[aDecoder decodeInt64ForKey:@"expires_in"];
        self.remind_in =[aDecoder decodeInt64ForKey:@"remind_in"];
        self.uid =[aDecoder decodeInt64ForKey:@"uid"];

    }
    return self;
}

@end
